#include "tcp_server.hpp"
#include <memory>

//指令使用文档
static void Usage(string pro)
{
    cout << "Usage:\n\t" << pro << " prot" << endl;
}

//回调函数
string remsg(const string& msg)
{
    return msg;
}

int main(int argc, char* argv[])
{   
    //指令输入错误
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_FAIL);
    }

    unique_ptr<tcp_server> up_tcps(new tcp_server(remsg, stoi(argv[1]))); //智能指针

    up_tcps->init();
    up_tcps->start();
    
    return 0;
}